package com.example.rocketmq.demo;

import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.ConsumeMode;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

/**
 * 消费
 */
@Component
// @RocketMQMessageListener(topic = "${rocketmq.producer.customized-trace-topic}",consumerGroup = "c-g",
//         consumeMode = ConsumeMode.ORDERLY,selectorExpression = "*")
@Slf4j
public class Consumer implements RocketMQListener<String> {

    @Override
    public void onMessage(String message) {
        // TODO: 2020/12/4 消费的逻辑

        log.info("消费1 + 我收到消息了！消息内容为：" + message);

    }
}

